<?php

/*

Name	:	BOOTSCHAT V.1.0 BETA
Author	:	Ayi Takei
Website	:	http://blog.nogisa.com
Date	:	May-04-2014
Notes	:	Backup only :)

*/

$lang_choose='english';
//$lang_choose='indonesia';
//$lang_choose='yourlanguage'; // choose your language here!

if ($lang_choose == 'english'){

	 $lang = array (

			// lang ID "nav"
			'send' => 'send', 
			'nav2a' => 'Open Chat on full window',
			'nav2b' => 'Full Window',
			'nav3a' => 'Clik here to go to Admin CP',
			'nav3b' => 'Admin CP',
			'nav4a' => 'View Chat on mobile version',
			'nav4b' => 'Mobile version',
			
			// lang ID "pag"			
			'pag1' => 'First',
			'pag2' => 'First',
			'pag3' => 'Prev',
			'pag4' => 'Prev',
			'pag5' => 'Next',
			'pag6' => 'Next',
			'pag7' => 'Last',
			'pag8' => 'Last',
			'pag9' => 'Page',
			'pag10' => 'of',
			'pag11' => 'Jump to page',
			'pag12' => 'GO',
			
			// lang ID "forma"			
			'forma1' => 'message',
			'forma2' => 'name',
			'forma3' => 'url',
			'forma4' => 'First',
			'forma5' => 'First',
			
			// lang ID "mess"		
			'mess1' => 'send on',	
			
			// lang ID "ntf"			
			'ntf1' => 'Error! empty name.',
			'ntf2' => 'Error! name too short. min 4 character',
			'ntf3' => 'Error! name too long. max 15 character',
			'ntf4' => 'Error! empty url',
			'ntf5' => 'Error! url too long. max 300 character',
			'ntf6' => 'Error! empty message',
			'ntf7' => 'Error! message too long. max 400 character',	
			
			// lang ID "ntfjs"			
			'ntfjs1' => 'Error! Enter a PAGE number between',
			'ntfjs2' => 'and',
			
			// lang ID "ftr"			
			'ftr1' => 'Open chat on Mobile Version',
			'ftr2' => 'Mobile version',
			
		);
	}

if ($lang_choose == 'indonesia'){

	 $lang = array (

			// lang ID "nav"
			'send' => 'Kirim', 
			'nav2a' => 'Buka obrolan pada jendela penuh',
			'nav2b' => 'Jendela Penuh',
			'nav3a' => 'Klik di sini untuk pergi ke Admin CP',
			'nav3b' => 'Admin CP',
			'nav4a' => 'Tampilkan obrolan pada Versi Mobile',
			'nav4b' => 'Versi Mobile',
			
			// lang ID "pag"			
			'pag1' => 'pertama',
			'pag2' => 'pertama',
			'pag3' => 'sebelum',
			'pag4' => 'sebelum',
			'pag5' => 'maju',
			'pag6' => 'maju',
			'pag7' => 'terahir',
			'pag8' => 'terahir',
			'pag9' => 'Halaman',
			'pag10' => 'dari',
			'pag11' => 'Meloncat ke halaman',
			'pag12' => 'PERGI',
			
			// lang ID "forma"			
			'forma1' => 'pesan',
			'forma2' => 'nama',
			'forma3' => 'url',
			'forma4' => 'First',
			'forma5' => 'First',
			
			// lang ID "mess"		
			'mess1' => 'send on',	

			// lang ID "ntf"			
			'ntf1' => 'send on',
			'ntf2' => 'send on',
			'ntf3' => 'send on',
			'ntf4' => 'send on',
			'ntf5' => 'send on',
			'ntf6' => 'send on',
			'ntf7' => 'send on',			

			// lang ID "ntf"			
			'ntf1' => 'Kesalahan! nama kosong',
			'ntf2' => 'Kesalahan! nama terlalu singkat. min 4 karakter',
			'ntf3' => 'Kesalahan! nama terlalu panjang. max 15 karakter',
			'ntf4' => 'Kesalahan! url kosong',
			'ntf5' => 'Kesalahan! url terlalu panjang. max 300 karakter',
			'ntf6' => 'Kesalahan! pesan kosong',
			'ntf7' => 'Kesalahan! pesan terlalu panjang. max 400 karakter',	

			// lang ID "ntfjs"			
			'ntfjs1' => 'Kesalahan! Masukan nomor HALAMAN antara',
			'ntfjs2' => 'dan',
			
			// lang ID "ftr"			
			'ftr1' => 'Buka chat pada Versi Mobile',
			'ftr2' => 'Versi Mobile',
		);
	}

if ($lang_choose == 'yourlanguage'){ // add your language here!

	 $lang = array (

	 /* 
	 
	 to add language just fill text to '' with your language.
	 
	 example: to setting Full Window to your language 
	 
	 'nav2b' => 'My Language', // 'Full Window', 
	 
	 */
			// lang ID "nav"
			'send' => '', // 'send', 
			'nav2a' => '', // 'Open Chat on full window',
			'nav2b' => '', // 'Full Window',
			'nav3a' => '', // 'Clik here to go to Admin CP',
			'nav3b' => '', // 'Admin CP',
			'nav4a' => '', // 'View Chat on mobile version',
			'nav4b' => '', // 'Mobile version',
			
			// lang ID "pag"			
			'pag1' => '', // 'First',
			'pag2' => '', // 'First',
			'pag3' => '', // 'Prev',
			'pag4' => '', // 'Prev',
			'pag5' => '', // 'Next',
			'pag6' => '', // 'Next',
			'pag7' => '', // 'Last',
			'pag8' => '', // 'Last',
			'pag9' => '', // 'Page',
			'pag10' => '', //'of',
			'pag11' => '', // 'Jump to page',
			'pag12' => '', // 'GO',
			
			// lang ID "forma"			
			'forma1' => '', // 'message',
			'forma2' => '', //'name',
			'forma3' => '', //'url',
			'forma4' => '', //'First',
			'forma5' => '', //'First',
			
			// lang ID "mess"		
			'mess1' => '', //'send on',	
			
			// lang ID "ntf"			
			'ntf1' => '', //'Error! empty name.',
			'ntf2' => '', //'Error! name too short. min 4 character',
			'ntf3' => '', // 'Error! name too long. max 15 character',
			'ntf4' => '', // 'Error! empty url',
			'ntf5' => '', // 'Error! url too long. max 300 character',
			'ntf6' => '', // 'Error! empty message',
			'ntf7' => '', // 'Error! message too long. max 400 character',	

			// lang ID "ntfjs"			
			'ntfjs1' => '', // 'Error! Enter a PAGE number between',
			'ntfjs2' => '', // 'and',
			
			// lang ID "ftr"			
			'ftr1' => '', // 'Open chat on Mobile Version',
			'ftr2' => '', // 'Mobile version',
		);
	}
	
/*
function minify_html_output($buffer) {

    $search = array(
        '/\>[^\S ]+/s',  // strip whitespaces after tags, except space
        '/[^\S ]+\</s',  // strip whitespaces before tags, except space
        '/(\s)+/s'       // shorten multiple whitespace sequences
    );

    $replace = array(
        '>',
        '<',
        '\\1'
    );

    $buffer = preg_replace($search, $replace, $buffer);

    return $buffer;
}

ob_start("minify_html_output");
*/
class Sql {
				  
		var $conn; 
		var $host;
		var $user;
		var $pass;
		var $db;
		var $result;
		var $lastid;
				
				
			
		// Constructor
		function Sql($host, $user, $pass, $db) {
			
			$this->host=$host;
			$this->user=$user;
			$this->pass=$pass;
			$this->db=$db;
			$this->conn = @mysql_connect($this->host, $this->user, $this->pass);
			@mysql_select_db($this->db, $this->conn);
			
		} 


		// Perform query
		function query($query) {
			
			if(!$this->result = @mysql_query($query, $this->conn)) {
			return false;
			}
			
			else
			return true;
			
		}


		// Count rows
		function count_rows($result) {
				
			return @mysql_num_rows($this->result);
			
		}


		// Fetch row
		function fetch_row() {
				
			return @mysql_fetch_array($this->result, MYSQL_ASSOC);
			
		}
			
			
		// Get the id for the last inserted row
		function get_id() {
		   
			$this->lastid = @mysql_insert_id($this->conn);
			return  $this->lastid;
			
		}

		//End of the class
	}

#------ Database connection details -------------------------------------------#
// Replace the variables with your MySQL connection info.
$dbhost = "localhost"; // Most likely 'localhost', so you don't need to change this in most of cases
$dbuser = "root"; // Your MySQL username
$dbpass = ""; // Your MySQL password
$dbname = "bootschat"; // Your MySQL database name


#------ Create an instance of Sql class ---------------------------------------#
// Connect to MySQL
$sql = new Sql($dbhost, $dbuser, $dbpass, $dbname);


$bootschat=isset($_GET['bootschat']) ? trim($_GET['bootschat']) : '';

switch ($bootschat){

		case 'bootstrap_3.0.2_custom_css':
		
		header("Content-Type: text/css; charset=UTF-8");
		
	echo'
		/*
		
		 Name: Bootstrap 3.0.2 Custom CSS  
		 URL: http://blog.nogisa.com
		 Date: May-05-2014	
		 This CSS only to overide default bootstrap 3.0.2 like Button, Pagination, Margin, font size, Padding etc..
		
		*/
		
		body {
		  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
		  font-size: 12px;
		  line-height: 1.428571429;
		  color: #333333;
		  background-color: #ffffff;
		}
		.panel-body {
		  padding: 2px;
		}
		.input-sm {
		  height: 20px;
		  padding: 5px 10px;
		  font-size: 12px;
		  line-height: 1.5;
		  border-radius: 3px;
		}
		.form-group {
		  margin-bottom: 1px;
		}
		.panel-footer {
		  padding: 2px 2px;
		  background-color: #f5f5f5;
		  border-top: 1px solid #dddddd;
		  border-bottom-right-radius: 3px;
		  border-bottom-left-radius: 3px;
		}
		.col-xs-1,
		.col-sm-1,
		.col-md-1,
		.col-lg-1,
		.col-xs-2,
		.col-sm-2,
		.col-md-2,
		.col-lg-2,
		.col-xs-3,
		.col-sm-3,
		.col-md-3,
		.col-lg-3,
		.col-xs-4,
		.col-sm-4,
		.col-md-4,
		.col-lg-4,
		.col-xs-5,
		.col-sm-5,
		.col-md-5,
		.col-lg-5,
		.col-xs-6,
		.col-sm-6,
		.col-md-6,
		.col-lg-6,
		.col-xs-7,
		.col-sm-7,
		.col-md-7,
		.col-lg-7,
		.col-xs-8,
		.col-sm-8,
		.col-md-8,
		.col-lg-8,
		.col-xs-9,
		.col-sm-9,
		.col-md-9,
		.col-lg-9,
		.col-xs-10,
		.col-sm-10,
		.col-md-10,
		.col-lg-10,
		.col-xs-11,
		.col-sm-11,
		.col-md-11,
		.col-lg-11,
		.col-xs-12,
		.col-sm-12,
		.col-md-12,
		.col-lg-12 {
		  position: relative;
		  min-height: 1px;
		  padding-right: 15px;
		  padding-left: 15px;
		}

		.row {
		  margin-right: -15px;
		  margin-left: -15px;
		}

		.pagination {
		  display: inline-block;
		  padding-left: 0;
		  margin: 0 0 -1px 4px;
		  border-radius: 4px;
		}

		.list-group {
		  padding-left: 0;
		  margin-bottom: 2px;
		}

		.pagination-sm > li > a,
		.pagination-sm > li > span {
		  padding: 1px 12px;
		  font-size: 11px;
		}

		.list-group-item {
		  position: relative;
		  display: block;
		  padding: 1px 1px;
		  margin-bottom: -1px;
		  background-color: #ffffff;
		  border: 1px solid #dddddd;
		}';	
		
		break;
		
		case 'processing_anim_gif': // store image ajax procesing/loading gif to base 64
		
		 header("Content-Type: image/gif; charset=UTF-8");
		
					echo''.base64_decode('
			R0lGODlhOAA4APcAAP///8jIyEBAU8vLy/7+/tLS0vz8/Nvb2/X19czMzPv7+83Nzfn5+c7OzsrKytTU1P39/dDQ0NnZ2dzc3PHx8ezs7PPz8+jo6OHh4ff3997e3t3d3dbW1uTk5PDw8O7u7uXl5dPT0+Pj4+/v7/Ly8urq6tHR0d/f38nJyfr6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AgRo0GEGSyBvYioA8EKqV6kvNJzw+IQNgApf00ql2UBtWpoMMAxwuzZoCQlR3wZV6AGEixBtAwIAIfkEBAoAAAAsAAAdABAAFwAACJYAdQgYKEAMgIMIEzYhKCBJwocAkDBEAjHhEIY6FFQ8yIShgDQbAVTxyCSkEYEEf4QEkMRjl5B/PBIxaYOhw5B5Bk5xshKAECqCIBzM8cHkwRILAiRIEZJCgQBQAzwQWrFC1KgSCGw8cBUqD40VTXQNEAFBRQYNxg5QURHBgLEbNrpFcZXpRrR0A4DoacAFWa18VYzwGRAAIfkEBAoAAAAsAAAPAAgAGwAACIMAAQDwcSSLQAUC6QgQEEXLwSYLFxIBUCfiwiQAhlgU0EUBDos/AGDZqAZAm40OiVjUgxCNxSgCIUbECECHRTECc+rcqdNBgJ8BWAhcADTAAYEPij4QeKCoAwIAQDi1MNBpB4EolEJtWhQBgApOj0IYUFRsjp8mPORksOACVAM8SywICAAh+QQECgAAACwAAAQAEAAXAAAIlAABCBxIUKCcKgBaFCwIZImAGxAILBwo5IeAi1ImCiyy5+JFHD0mFsHh0WOYhUKClLyo5AnDGysfnlnocCUgIAvlxOSiYKKbKSV/+NAoUIoNATbiaKRRQmCPMH80dggQIIQFogITUKU6geiIrVyJHgAbAAFRrVsLeEUBVgTRGGSvapxAVqLGB2BDYF0A9sDetnYnBgQAIfkEBAoAAAAsBAAAABcAEAAACJAAAQgcSLAgAAVb8BCJckOAwYdG1iRRIqCixYcEe9DBYbFjRYwDj3gcifEDBQBfRnp8uCFAAQIQGo7EgWRJQQYFAui8AACLxSlqtvSAuECnzgQKABAZkgYkAAQJjBo94XQggwZSj1aoKtBEVpcyuALQ8JWDAbEfysJEm9Poy7ViCVwYoJNBXIElBCo4sfUugIAAOw==
			').'';
		
		break;

		case 'send':
		
			session_start();
			header("Expires: Sat, 05 Nov 2005 00:00:00 GMT");
			header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
			header("Cache-Control: no-store, no-cache, must-revalidate");
			header("Cache-Control: post-check=0, pre-check=0", false);
			header("Pragma: no-cache");
			header("Content-Type: text/xml; charset=UTF-8");

			//  FORM input validation using PHP to hanle if browser not suport javascript validation
			//if ( ((isset($_POST['name']))
			
				//if (trim($_POST['name'] !== "name" )){
				
					//$error_msg='uuuuu';
				
				//}

				// lang ID "ntf" start
				if (strlen($_POST['message']) > 400){
				
					$error_msg=$lang['ntf7'];
				
				}				
				if (trim($_POST['message'] == '' )){ 
				
					$error_msg=$lang['ntf6'];
				
				}
				
				if (strlen($_POST['url']) > 300){
				
					$error_msg=$lang['ntf5'];
				
				}				
				if (trim($_POST['url'] == '' )){ 
				
					$error_msg=$lang['ntf4'];
				
				}
				
				if (strlen($_POST['name']) > 15){
				
					$error_msg=$lang['ntf3'];
				
				}
				if (strlen($_POST['name']) < 4){
				
					$error_msg=$lang['ntf2'];
				
				}					
				if (trim($_POST['name'] == '' )){ 
				
					$error_msg=$lang['ntf1'];
				
				}

				
				//&& (trim($_POST['name'] !== "name" ))
				//&& (strlen($_POST['name']) < 15))
				//&& ((isset($_POST['url']))
				//&& (strlen($_POST['url']) < 100))
				//&& ((isset($_POST['message']))
				//&& (trim($_POST['message']) !== "" )
				//&& (trim($_POST['message']) !== "message" )
				//&& (strlen($_POST['message']) < 400))
				//&& (isset($_SESSION['token'])	
				
				// if user post from Desktop Version, then set referer to default				
				if (($_POST['referer'] == 'desktop' )){ 
				
					$referer='default';
				
				}
				
				// if user post from Mobile Version, then set referer to Mobile 				
				if (($_POST['referer'] == 'mobile' )){ 
				
					$referer='mobile';
				
				}
				
				if ( ($error_msg =='' && $_POST['token'] == $_SESSION['token']) ) {

						$name = $_POST['name'];
						$url = trim($_POST['url']);

						if ((strstr($url, 'http://') && strlen($url) == 7) || $url == "") {
						
						unset($url);
					   
						}
					  
						$msg=$_POST['message'];
					 

						// Get a sender IP (it will be in use in the next wTag version)
						$remote = $_SERVER["REMOTE_ADDR"];
						// Store it converted
						$converted_address=ip2long($remote);
					   
						
						if (get_magic_quotes_gpc()) {
						 
						$name = mysql_real_escape_string(stripslashes($name));
						$url = mysql_real_escape_string(stripslashes($url));
						$msg = mysql_real_escape_string(stripslashes($msg));
						
						}
						
						else {
						 
						$name = mysql_real_escape_string($name);
						$url = mysql_real_escape_string($url);
						$msg = mysql_real_escape_string($msg);
						  
						}

						// Insert a new message into database
						$sql->query("INSERT INTO chat SET name= '$name', url='$url', message= '$msg', ip='$converted_address', date=now()");
						
						// if referer value "default" then redirect to http://example.com/bootschat.php?bootschat=default 
						// if referer value "mobile" then redirect to http://example.com/bootschat.php?bootschat=mobile
						header('location: bootschat.php?bootschat='.$referer.'&success=send');
				
				    }else{
					
						// Just retrieve last 20 messages
						//$sql->query("SELECT date, name, url, message FROM wtagshoutbox ORDER BY messageid DESC LIMIT 20");
						
						// if referer value "default" then redirect to http://example.com/bootschat.php?bootschat=default 
						// if referer value "mobile" then redirect to http://example.com/bootschat.php?bootschat=mobile
						header('location: bootschat.php?bootschat='.$referer.'&error='.(base64_encode($error_msg)).'');
       
					}
				
						//header('location: bootschat.php?bootschat=default');
						
		break;
		//exit;

		case 'load_data':

			if($_POST['page'])
			{
				$page = $_POST['page'];
				$cur_page = $page;
				$page -= 1;
				$per_page = 10;
				$previous_btn = true;
				$next_btn = true;
				$first_btn = true;
				$last_btn = true;
				$start = $page * $per_page;

				$sql->query("SELECT * FROM  `chat` ORDER BY  `chat`.`chatid` DESC LIMIT $start, $per_page");
				//$result_pag_data = mysql_query($sql) or die('MySql Error' . mysql_error());
				$msg = "";
			
				while ($row=$sql->fetch_row()) {

					//$date = $row['date'];
					$name = $row['name'];
					$url = $row['url'];
					$message = $row['message'];
					$date = $row['date'];

					$name = htmlspecialchars($name);
					$url = htmlspecialchars($url);
					$message = htmlspecialchars($message);
					$htmlmsg=htmlentities($row['message']);
					
					$time=substr(''.$date.'',11,5);
					
					// lang ID "mess" start
					$msg .= "<li class='list-group-item'><small title='".$lang['mess1']." ".$date."'>".$time."</small> <a data-toggle-tooltip='tooltip' data-placement='top' title='".$url."' href='".$url."'>".$name."</a> : " . $htmlmsg . "</li>";
					// lang ID "mess" end
					  
				}
			
				//while ($row = mysql_fetch_array($sql)) {
				//$htmlmsg=htmlentities($row['message']);
				//	$msg .= "<li><b>" . $row['chatid'] . "</b> " . $htmlmsg . "</li>";
				//}
				$msg = "<div class='data tooltip-fgs'><ul class='list-group small'>" . $msg . "</ul></div>"; // Content for Data


				/* --------------------------------------------- */
				$query_pag_num = "SELECT COUNT(*) AS count FROM chat";
				$result_pag_num = mysql_query($query_pag_num);
				$row = mysql_fetch_array($result_pag_num);
				$count = $row['count'];
				$no_of_paginations = ceil($count / $per_page);

				/* ---------------Calculating the starting and endign values for the loop----------------------------------- */
				if ($cur_page >= 7) {
				
					$start_loop = $cur_page - 3;
					if ($no_of_paginations > $cur_page + 3)
						$end_loop = $cur_page + 3;
					else if ($cur_page <= $no_of_paginations && $cur_page > $no_of_paginations - 6) {
					
						$start_loop = $no_of_paginations - 6;
						$end_loop = $no_of_paginations;
						
					} else {
						$end_loop = $no_of_paginations;
					}
				} else {
				
						$start_loop = 1;
						if ($no_of_paginations > 7)
							$end_loop = 7;
						else
							$end_loop = $no_of_paginations;
							
					}
				/* ------------- */
				// lang ID "pag" start
				$msg .= "<div class=''><ul class='pagination pagination-sm'>";

					// FOR ENABLING THE FIRST BUTTON
					if ($first_btn && $cur_page > 1) {
						$msg .= "<li p='1' class='active2'><a href='#'>&laquo;&laquo; ".$lang['pag1']."<span class='sr-only'>(current)</span></a></li>";
					} else if ($first_btn) {
						$msg .= "<li p='1' class='disabled'><a href='#'>&laquo;&laquo; ".$lang['pag2']."</a></li>";
					}

					// FOR ENABLING THE PREVIOUS BUTTON
					if ($previous_btn && $cur_page > 1) {
						$pre = $cur_page - 1;
						$msg .= "<li p='$pre' class='active2'><a href='#'>&laquo; ".$lang['pag3']."<span class='sr-only'>(current)</span></a></li>";
					} else if ($previous_btn) {
						$msg .= "<li class='disabled'><a href='#'>&laquo; ".$lang['pag4']."</a></li>";
					}
					for ($i = $start_loop; $i <= $end_loop; $i++) {

					   // if ($cur_page == $i)
						//    $msg .= "<li p='$i' class='active'><a href='#'>{$i}</a></li>";
						//else
						//    $msg .= "<li p='$i' class='active2'><a href='#'>{$i}</a></li>";
					}

					// TO ENABLE THE NEXT BUTTON
					if ($next_btn && $cur_page < $no_of_paginations) {
						$nex = $cur_page + 1;
						$msg .= "<li p='$nex' class='active2'><a href='#'>".$lang['pag5']." &raquo;</a></li>";
					} else if ($next_btn) {
						$msg .= "<li class='disabled'><a href='#'>".$lang['pag6']." &raquo;</a></li>";
					}

					// TO ENABLE THE END BUTTON
					if ($last_btn && $cur_page < $no_of_paginations) {
					
						$msg .= "<li p='$no_of_paginations' class='active2'><a href='#'>".$lang['pag7']." &raquo;&raquo;</a></li>";
						
					} else if ($last_btn) {
					
							 $msg .= "<li p='$no_of_paginations' class='disabled'><a href='#'>".$lang['pag8']." &raquo;&raquo;</a></li>";
						
							}
								
					//$goto = "<input type='text' class='goto' size='1' style='margin-top:-1px;margin-left:60px;'/><input type='button' id='go_btn' class='go_button' value='Go'/>";
					
			 $goto = "<div class='panel-footer'>					  
							<div class='col-xs-5'>									
								<div class='form-group'>										
									<p class='total small' a='$no_of_paginations'>".$lang['pag9']." " . $cur_page . " ".$lang['pag10']." $no_of_paginations</p>
								</div>
							</div>";
					
			 $total_string ="<div class='col-xs-7'>						
								<div class='input-group'>										
									<input type='text'  class='goto form-control input-sm' placeholder='".$lang['pag11']."'>
									<span class='input-group-btn'>
									<button class='btn btn-default btn-xs' id='go_btn' type='button'>".$lang['pag12']."</button>
									</span>											
								</div>
							</div>							
						</div>";
					
			 $msg = $msg . "</ul>" . $goto . $total_string . "</div>";  // Content for pagination
			 echo $msg;
			 // lang ID 'pag' end
			}

		break;
		exit;		
		
		case 'mobile': // Mobile Version without AJAX Script, without AJAX Pagination etc..

			session_start();
			$token = md5(uniqid(rand(), true));
			$_SESSION['token'] = $token;
			
			?>
			
			<!DOCTYPE html>
			<html>
					<head>
						<title>Bootstrap 101 Template</title>
						<meta name="viewport" content="width=device-width, initial-scale=1.0">
						
						<!-- link to official CDN Bootstrap 3.0.2 compiled and minified CSS -->						
						<!-- Main theme -->
						<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
						<!-- Optional theme -->
						<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap-theme.min.css">
						
						<!-- link to local Bootstrap 3.0.2 Custom CSS to overide button style, pagination style, etc.. -->
						<link href="bootschat.php?bootschat=bootstrap_3.0.2_custom_css" rel="stylesheet">

						<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
						<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
						<!--[if lt IE 9]>
						  <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
						  <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
						<![endif]-->
							
					</head>
					
					    <body>
						 
							<div class="panel panel-primary">
							
								<!--div class="panel-heading"-->
								
								<nav class="navbar navbar-inverse" role="navigation">
								  <!-- Brand and toggle get grouped for better mobile display -->
								  <div class="navbar-header">
									<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
									  <span class="sr-only">Toggle navigation</span>
									  <span class="icon-bar"></span>
									  <span class="icon-bar"></span>
									  <span class="icon-bar"></span>
									</button>
									<a class="navbar-brand" href="#">Brand</a>
								  </div>

								  <!-- Collect the nav links, forms, and other content for toggling -->
								  <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
									<ul class="nav navbar-nav">
									  <li><a href="bootschat.php" target="blank" title="<?php echo$lang['2'];?>"><?php echo$lang['3'];?></a></li>
									  <li><a href="bootschat.php?bootschat=admin_cp" target="blank" title="Admin Control Panel">Admin CP</a></li>
									  <li><a href="bootschat.php?bootschat=mobile" target="blank" title="Open Chat Mobile Version">Mobile Version</a></li>
									</ul>
									
								  </div><!-- /.navbar-collapse -->
								</nav>								
								<!--ul class="nav">
 
	  <a href="bootschat.php" target="_blank" type="button" class="btn btn-default btn-xs pull-right">
									  <span class="glyphicon glyphicon-star"></span> Full Window
									</a>

</ul-->
								

									
								<!--/div-->
																
								    <div class="panel-body">
								  								  
									<ul class="list-group small">
									
										<?php 
										
											//setting
											$color1="success";
											$color2="danger";
											$color=$color1;
											
										 $sql->query("SELECT name, url, message FROM chat ORDER BY chatid DESC LIMIT 20");
							
											while ($row=$sql->fetch_row()) {
											
													if($color==$color1){
													
													 $color=$color2;
													
													}else{
													
													 $color=$color1;
													
													}
													
													$name = $row['name'];
													$url = $row['url'];
													$message = $row['message'];

													$name = htmlspecialchars($name);
													$url = htmlspecialchars($url);
													$message = htmlspecialchars($message);
																		
												 echo'<li class="list-group-item alert alert-'.$color.'"><a href="'.$url.'">'.$name.'</a> : '.$message.'</li>';
									
												}
										?>
										
									</ul>
		

									
									<!--ul class="pagination pagination-sm">
										<li class="disabled"><a href="#">&laquo;</a></li>
										<li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
									...
									</ul-->
									
								    </div>	  
								  
								<div class="panel-footer">
								<?php 
								$error_msg=isset($_GET['error']) ? trim($_GET['error']) : '';
								if ($error_msg !==''){
								
									echo'<div class="alert alert-danger">'.(base64_decode($error_msg)).'</div>';
								
								}
								?>
							  							  
									<form action="bootschat.php?bootschat=send" method="POST" role="form" onsubmit="return validasi_input(this)"> <!-- first, falidation form using Javascript-->

										<div class="row">  
										  <div class="col-xs-12">  
											<div class="form-group">
											<textarea name="message" class="form-control input-sm" rows="1" placeholder="message"></textarea>
											</div>
										   </div>
										</div>
										 
										<div class="row">  
										
											<div class="col-xs-4">
											
												<div class="form-group">
													<input name="name" type="text" class="form-control input-sm" id="exampleInputEmail1" placeholder="name">
												</div>
											</div>
											
											<div class="col-xs-4">						
												<div class="form-group">
													<input name="url" type="text" class="form-control input-sm" placeholder="url">
												</div>
											</div>	
											
											<input type='hidden' id='token' name='token' value='<?php echo $token; ?>' />
											<input type='hidden' id='referer' name='referer' value='mobile' /> <!-- set referer value to mobile -->
											
											<div class="col-xs-4">
												<div class="form-group">
													<button type="submit" class="btn btn-xs btn-primary"><?php echo$lang['send'];?></button>
												</div>
											</div>
											
										</div>
										
								
									</form>
							  
								</div>
							  
								<div class="panel-footer small">BootsChat v.1.0 by @ayitakei - 
								
								<a href="bootschat.php?bootschat=default" target="blank" title="Open Chat Desktop Version">Desktop Version</a>
								
								</div>
								
							</div>
							
							<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
							<!--script src="js/jquery.js"></script-->
							<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> 
							
		<script type="text/javascript">
		
            $(document).ready(function(){
                function loading_show(){
                    $('#loading').html("<img src='images/processing-anim.gif'/>").fadeIn('fast');
                }
                function loading_hide(){
                    $('#loading').fadeOut('fast');
                }                
                function loadData(page){
                    loading_show();                    
                    $.ajax
                    ({
                        type: "POST",
                        url: "bootschat.php?bootschat=load_data",
                        data: "page="+page,
                        success: function(msg)
                        {
                            $("#container").ajaxComplete(function(event, request, settings)
                            {
                                loading_hide();
                                $("#container").html(msg);
                            });
                        }
                    });
                }
                loadData(1);  // For first time page load default results
                $('#container .pagination li.active2').live('click',function(){
                    var page = $(this).attr('p');
                    loadData(page);
                    
                });           
                $('#go_btn').live('click',function(){
                    var page = parseInt($('.goto').val());
                    var no_of_pages = parseInt($('.total').attr('a'));
                    if(page != 0 && page <= no_of_pages){
                        loadData(page);
                    }else{
                        alert('Enter a PAGE between 1 and '+no_of_pages);
                        $('.goto').val("").focus();
                        return false;
                    }
                    
                });
            });
						
        </script>
		
							<!-- Include all compiled plugins (below), or include individual files as needed -->
							<script src="js/bootstrap.min.js"></script>

		<script type="text/javascript">
			
			// global tooltip
			$('.tooltip-fgs').tooltip({
			  selector: "[data-toggle-tooltip=tooltip]",
			  container: "body"
			})

			$('.tooltip-test').tooltip()
			$('.popover-test').popover()

			$('.bs-docs-navbar').tooltip({
			  selector: "a[data-toggle-tooltip=tooltip]",
			  container: ".bs-docs-navbar .nav"
			})

			// popover
			$("[data-toggle=popover]")
			  .popover()
			  ;  
			
        </script>
							
					    </body>
			</html>
			
			<?php

		break;
		exit;
		
		default : // Desktop Version full using  AJAX Script, AJAX Navigation, JS Form validation ect..
		
			session_start();
			$token = md5(uniqid(rand(), true));
			$_SESSION['token'] = $token;
			
			?>
			
			<!DOCTYPE html>
			<html>
					<head>
						<title>Bootstrap 101 Template</title>
						<meta name="viewport" content="width=device-width, initial-scale=1.0">
						
						<!-- link to official CDN Bootstrap 3.0.2 compiled and minified CSS -->						
						<!-- Main theme -->
						<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css">
						<!-- Optional theme -->
						<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap-theme.min.css">
						
						<!-- link to local Bootstrap 3.0.2 Custom CSS to overide button style, pagination style, etc.. -->
						<link href="bootschat.php?bootschat=bootstrap_3.0.2_custom_css" rel="stylesheet">

						<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
						<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
						<!--[if lt IE 9]>
						  <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
						  <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
						<![endif]-->
						
				<script type="text/javascript">		
			
			//  FORM input Falidation using Javascript
			
			// Username empty validation
				function validasi_input(form){
				
					if (form.name.value == ""){
					alert("Error! Please insert your name. if you want to auto fill name, login to your acount.");
					form.name.focus();
					return (false);
					}
					//return (true);
					
				  // Only A-Z a-z 0-9 Character validation  
				   pola_username=/^[a-zA-Z0-9\_\ \-]{4,15}$/;
				   if (!pola_username.test(form.name.value)){
					  alert ('Min 4 character Max 15 character. A-Z a-z 0-9 Character and space Only! symbol not allowed.');
					  form.name.focus();
					  return false;
				   }	
					
					// Min Character Username validation
				  var mincar = 4;
				  if (form.name.value.length < mincar){
					alert("Error! Min Name 4 Character");
					form.name.focus();
					return (false);
				  }
				   //return (true);
				   
					// Max Character Username validation
				  var maxcar = 15;
				  if (form.name.value.length > maxcar){
					alert("Error! Max Name 15 Character");
					form.name.focus();
					return (false);
				  }
				   //return (true);  
				   
					if (form.text.value == ""){
					alert("Error! Please insert your comment.");
					form.text.focus();
					return (false);
					}  
				
				}	  
			
        </script>						
						
					</head>
					
					    <body>
						 
							<div class="panel panel-primary">
							
								<!--div class="panel-heading"-->

<!-- lang ID "nav" start -->	
<nav class="navbar navbar-inverse" role="navigation">
  <!-- Brand and toggle get grouped for better mobile display -->
  <div class="navbar-header tooltip-fgs">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" data-toggle-tooltip='tooltip' data-placement='bottom' title='yyyy' href="#">Brand</a>
  </div>

  <!-- Collect the nav links, forms, and other content for toggling -->
  <div class="collapse navbar-collapse tooltip-fgs" id="bs-example-navbar-collapse-1">
    <ul class="nav navbar-nav">
      <li><a href="bootschat.php" target="blank" data-toggle-tooltip='tooltip' data-placement='bottom' title="<?php echo$lang['nav2a'];?>"><?php echo$lang['nav2b'];?></a></li>
      <li><a href="bootschat.php?bootschat=admin_cp" target="blank" data-toggle-tooltip='tooltip' data-placement='bottom' title="<?php echo$lang['nav3a'];?>"><?php echo$lang['nav3b'];?></a></li>
	  <li><a href="bootschat.php?bootschat=mobile" target="blank" data-toggle-tooltip='tooltip' data-placement='bottom' title="<?php echo$lang['nav4a'];?>"><?php echo$lang['nav4b'];?></a></li>
    </ul>
	
  </div><!-- /.navbar-collapse -->
</nav>								
<!-- lang ID "nav" end -->								<!--ul class="nav">
 
	  <a href="bootschat.php" target="_blank" type="button" class="btn btn-default btn-xs pull-right">
									  <span class="glyphicon glyphicon-star"></span> Full Window
									</a>

</ul-->
								

									
								<!--/div-->
																
								    <div class="panel-body">
								  
										<div id="loading" align="center"></div>
										<div id="container">
											<div class="data"></div>
											<div class="pagination"></div>
										</div>
									
								    </div>	  
								  
								<div class="panel-footer">
								<?php 
								$error_msg=isset($_GET['error']) ? trim($_GET['error']) : '';
								if ($error_msg !==''){
								
									echo'<div class="alert alert-danger">'.(base64_decode($error_msg)).'</div>';
								
								}
								?>
							  		
									<!-- lang ID "forma" start -->
									<form action="bootschat.php?bootschat=send" method="POST" role="form" onsubmit="return validasi_input(this)"> <!-- first, falidation form using Javascript-->

										<div class="row">  
										  <div class="col-xs-12">  
											<div class="form-group">
											<textarea name="message" class="form-control input-sm" rows="1" placeholder="<?php echo$lang['forma1'];?>"></textarea>
											</div>
										   </div>
										</div>
										 
										<div class="row">  
										
											<div class="col-xs-4">
											
												<div class="form-group">
													<input name="name" type="text" class="form-control input-sm" id="exampleInputEmail1" placeholder="<?php echo$lang['forma2'];?>">
												</div>
											</div>
											
											<div class="col-xs-4">						
												<div class="form-group">
													<input name="url" type="text" class="form-control input-sm" placeholder="<?php echo$lang['forma3'];?>">
												</div>
											</div>	
											
											<input type='hidden' id='token' name='token' value='<?php echo $token; ?>' />
											<input type='hidden' id='referer' name='referer' value='desktop' /> <!-- set referer value to desktop -->
											
											<div class="col-xs-4">
												<div class="form-group">
													<button type="submit" class="btn btn-xs btn-primary"><?php echo$lang['send'];?></button>
												</div>
											</div>
											
										</div>
										
								
									</form>
									<!-- lang ID "form1" end -->
							  
								</div>
<div class='col-md-3 tooltip-fgs'>				
 <ul class='list-group'>
	<li class='list-group-item'><button type='button' class='btn btn-info' data-toggle-tooltip='tooltip' data-placement='top' title='No link profile to This Author. some author has disable her user link profil or non member'><i class='glyphicon glyphicon-user'></i> hhhhhhhh</button></li>';							
 </ul>
</div>							
								<!-- lang ID "ftr" star -->
								<div class="panel-footer small tooltip-fgs">	BootsChat v.1.0 by @ayitakei - 
								
								<a href="bootschat.php?bootschat=mobile" target="blank" data-toggle-tooltip="tooltip" data-placement="top" title="<?php echo$lang['ftr1'];?>"><?php echo$lang['ftr2'];?></a>
								
								</div>
								<!-- lang ID "ftr" end -->
								
							</div>							
							
							<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
							<!--script src="js/jquery.js"></script-->
							<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> 
	
							<!-- Include all compiled plugins (below), or include individual files as needed -->
							<script src="js/bootstrap.min.js"></script>

		<!-- 
		
			AJAX Pagination Minify version to make more faster loading.
			if you want to change something you can get original source this code from this link:
			http://code.google.com/p/bootschat/source/browse/javascript/ajax_pagination_non_minify.js
			
			Note: this ajax only work on Jquery 1.8.0 and other version under 1.8.0
			
		-->		
		<script type="text/javascript">$(document).ready(function(){function b(){$("#loading").html("<img src='bootschat.php?bootschat=processing_anim_gif'/>").fadeIn("fast")}function c(){$("#loading").fadeOut("fast")}function a(d){b();$.ajax({type:"POST",url:"bootschat.php?bootschat=load_data",data:"page="+d,success:function(e){$("#container").ajaxComplete(function(h,g,f){c();$("#container").html(e)})}})}a(1);$("#container .pagination li.active2").live("click",function(){var d=$(this).attr("p");a(d)});$("#go_btn").live("click",function(){var e=parseInt($(".goto").val());var d=parseInt($(".total").attr("a"));if(e!=0&&e<=d){a(e)}else{alert("<?php echo$lang['ntfjs1'];?> 1 <?php echo$lang['ntfjs2'];?> "+d);$(".goto").val("").focus();return false}})});</script>
					
		<script type="text/javascript">
			
			// global tooltip
			$('.tooltip-fgs').tooltip({
			  selector: "[data-toggle-tooltip=tooltip]",
			  container: "body"
			})

			$('.tooltip-test').tooltip()
			$('.popover-test').popover()

			$('.bs-docs-navbar').tooltip({
			  selector: "a[data-toggle-tooltip=tooltip]",
			  container: ".bs-docs-navbar .nav"
			})

			// popover
			$("[data-toggle=popover]")
			  .popover()
			  ;  
			
        </script>
							
					    </body>
			</html>
			
	 <?php
			
		break;
	
	}	

	 ?>	